<?php


$this->breadcrumbs=array(
	'Update Estudios'=>array('updateEstudios/index'),
	'View',
);
?>

<!--  
  <h1><?php echo $this->id . '/' . $this->action->id; ?></h1> 
-->
<div class="form">
<?php echo  CHtml::beginForm();?>

<div id="estudiosHeader" style="height:153px;">

<table>
	<tr style="background-color:#6FACCF; color:white" ><th style="text-align:right">Datos Generales </th><th></th></tr>	
	
	<tr>
		<td	style="text-align:right">
			Paciente
		</td>
		<td>
			<?php echo CHTml::dropDownList('paciente', $this->nombrePaciente . ' ' . $this->apellidoPaciente,array('Facundo Benitez', 'Veronica Gimenez','Roberto Gimenez')) ?>
		</td>
		
	</tr>		
	
	<tr>
		<td style="text-align:right">
			Etapa
		</td>
		<td>
	  	  <?php echo CHTml::dropDownList('idEtapa','idEtapa',$this->getEtapas(), array('onchange'=>'this.form.submit()')); ?>
		</td>
	</tr>
	<tr>
		<td style="text-align:right">
			Fecha del Estudio
		</td>
		<td>
			<div class="row">
			<?php 
				$this->widget('zii.widgets.jui.CJuiDatePicker', array(
	    			'name'=>'fechaEstudio',
	  				  // additional javascript options for the date picker plugin
	   				 'options'=>array(
	      			  'showAnim'=>'fold',
	    			),
	    			'htmlOptions'=>array(
	        		'style'=>'height:20px;'),
				));
			?>
			</div>
		</td>
	</tr>
	
	
</table>

</div>

<?php 
	if(isset($_POST['idEtapa'])){
		$estudios = $this->getEstudios($_POST['idEtapa']);
	}else{
		$estudios = $this->getEstudios(1);
	}
?>

<div id="estudiosDetail">
	<table>
		<tr style="background-color:#6FACCF; color:white" ><th style="text-align:right">Tipo de Estudio </th><th>Resultado</th></tr>	
		<?php foreach ($estudios as $estudio){?>
			<tr>
				<td style="text-align:right"> <?php echo($estudio->nombreEstudio); ?></td>
				
				<?php 
					$inputType = "Text";
					/*
					if ($estudio->tipoResultado == "Boolean"){
						$inputType = "radio";
					}
					*/
	
				?>
					
				<td> <input type='<?php echo($inputType)?>' value=''/> </td>
		
		
			</tr>
		<?php }?>
	</table>
</div>

<div style="text-align:center">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>

</div>
		
<?php echo CHtml::endForm(); ?>

</div>